#include <iostream>
#include <pthread.h>
#include <unistd.h>

using namespace std;

int g_val = 10;
// 新线程
void *threadRoutine(void *args)
{
}

int main()
{
    pthread_t tid;
    pthread_create(&tid, nullptr, threadRoutine, nullptr); 

    while (true)
    {
        printf("主线程 pid: %d, g_val: %d,\
        &g_val: 0x%p,子线程id:%p \n", getpid(), g_val, &g_val,tid);
        sleep(1);
        g_val++;
    }

    return 0;
}